home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-20
/
rs0422.zip
/
ROSEZSW
/
INIT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-11-13
|
6KB
|
189 lines
/*
* Copyright 1988 by the Radio Amateur Telecommunications Society
* and Thomas A. Moulton, W2VY
*
* This software may only be modified, copied, distributed or
* executed for non-profit purposes by individuals operating
* systems in the Amateur Radio Service. Credit to the
* author(s) and to the Radio Amateur Telecommunications Society
* must be made in modules where RATS provided software is used,
* and in any announcements and documentation.
*
* As a non-profit, research and development organization, the
* Radio Amateur Telecommunications Society distributes software
* in both executable and source forms. This policy is in place
* to encourage the development and distribution of OSI-based,
* networking tools. In order to protect the interests of the
* Society and the authors, we have placed some conditions
* of use on the software. Other groups are encouraged
* to place the same or similar guidelines on
* software they produce.
*
* The Radio Amateur Telecommunications Society reserves the right
* to specify and alter the terms under which software provided by
* the Society may be used. This policy is consistent with the
* objective of uniform and consistent "Open Systems Interconnections."
*
* All acceptable Amateur Radio related uses of this software
* will be outlined in the "ROSE Implementer's Guide". Individuals
* or organizations wishing to add to, or modify the provisions of
* the guide to accommodate local or evolutionary requirements
* should document the proposed change(s) and forward them to the
* Society. If accepted, written notification will be provided by
* the Society to the submitting organization or individual(s).
* The Society will then issue a "ROSE Implementer's Guide Change
* Notice". Periodically, the Society will re-issue the "ROSE
* Implementer's Guide" and incorporate the text of the change
* notices. This procedure has been put in to place to ensure
* compatibility between systems and to ensure their "Openness"
* and interoperability.
*
* No part of this software may be used in other packages
* without prior authorization from the author or the Society.
* Software incorporating this module, all or in part, must be
* provided to the Society prior to distribution or use by
* anyone not directly involved in testing of the revised
* environment. Current releases of the combined software must
* be provided to the Society in both source and executable
* forms. Adequate documention to produce an executable module
* from the provided source must also be included.
*
* Non-Amateur Radio non-profit uses may be authorized on a case
* by case basis. Inquiries for such use may be made in writing
* to the Society. Non-commercial uses consistent with the
* general principles of Open Systems Interconnection Reference
* Model will be generally considered with favor.
*
* Commercial licensing of the software is also available based
* on normal commercial terms. Licensing inquiries should be
* directed to the Society. Commercial licensing of the standard
* software will be done in situations which materially benefit
* the Amateur Radio Packet Network. Additional licensing is
* reserved by the individual authors.
*
* The Radio Amateur Telecommunications Society provides this software
* on an "as is" basis. The Society assumes no liability for
* loss incurred through the use of this software. Amateur Radio
* use of this software implies non-commercial and voluntary
* development, deployment and use of this software in a "Amateur",
* non-commercial service. Commercial users are encouraged to
* inspect their copies of the source code. Source code modification
* licenses are available if a combined Object and Source Code
* license was not originally established.
*
* The Society may be contacted by writing or calling at:
*
* The Radio Amateur Telecommunications Society
* 206 North Vivyen Street.
* Bergenfield, New Jersey 07621
*
* Telephone: 201-387-8896
*
*/
/* This file will init the structs needed for L2 and L3 */
#include "data.h"
#include "buffer.h"
#include "iface.h"
#include "timer.h"
#include "ax25.h"
#include "ax25l2.h"
extern struct ax25_addr L3CALL[];
void level3();
int l3_st_up();
extern struct ax25_parms *l3parms;
void siosnd();
struct datastr *ax25l2();
int NULLFCN();
struct datastr *NULLPKT();
extern struct interface *ifaces[4];
struct interface port_null = {255, "None", NULLFCN, NULLPKT, NULLPKT, NULLFCN, NULLFCN };
struct interface port0 = {0, "P0", siosnd, ax25l2, NULLPKT, NULLFCN, NULLFCN };
struct interface port1 = {1, "P1", siosnd, ax25l2, NULLPKT, NULLFCN, NULLFCN };
#if 0
struct interface port2 = {2, "P2", siosnd, ax25l2, NULLPKT, NULLFCN, NULLFCN };
struct interface port3 = {3, "P3", siosnd, ax25l2, NULLPKT, NULLFCN, NULLFCN };
struct interface *difaces[4]= { &port0, &port1, &port2, &port3 };
#else
struct interface *difaces[4]= { &port0, &port1, &port_null, &port_null };
#endif
int l2_reset(), l2_clear(), l2_send(), l2_recv(), l2_con();
int (*dL2PARS[5])() = { l2_reset, l2_clear, l2_send, l2_recv, l2_con};
int l3_reset(), l3_clear(), l3_send(), l3_recv(), l3_connected();
int (*dL3PARS[5])() = { l3_reset, l3_clear, l3_send, l3_recv, l3_connected};
struct datastr *
NULLPKT()
{
return NULL;
}
void
siosnd(ifx, pkt)
struct interface *ifx;
struct datastr *pkt;
{
void SIO_SND();
SIO_SND(ifx->dev, pkt);
}
void
L1_RECV(pktx,chan)
struct datastr *pktx;
int chan;
{
static struct datastr *pkt;
static struct interface *ifx;
pkt=pktx;
ifx = ifaces[chan];
if (pkt) {
pkt=(struct datastr *)(*ifx->recv)(ifx, pkt);
free_pkt(pkt);
}
}
void
ASYBRK(chan)
int chan;
{}
void
restart()
{}
/* The above is used by the memory allocation routines when we run
out of memory, should have a reset function to call to attempt
to free up some memory, and a counter (error-level) and if it gets
called "too much" have it call restart... a few times then call boot() */
init()
{
void link_count();
queue(NULL,link_count,1,0); /* Dec link counters every second */
}
#if 0
void
restart()
{
static struct axcb *lnk;
lnk=links;
while (lnk) /* For all active links */ {
close_ax25(lnk);
}
}
#endif